home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / UUPC11QS.ARJ / DCP.H < prev    next >
C/C++ Source or Header  |  1991-10-05  |  5KB  |  121 lines

  1. #ifndef __DCP
  2. #define __DCP
  3. /*
  4.  *      History:77,17
  5.  *      Mon May 15 19:54:43 1989 change portactive to port_active
  6.  *      Mon May 15 19:51:13 1989 Add portactive flag
  7.  *      19 Mar 1990  Add hostable.h header                           ahd
  8.  *
  9.  */
  10.  
  11. /*
  12.         For best results in visual layout while viewing this file, set
  13.         tab stops to every 4 columns.
  14. */
  15.  
  16. /*
  17.         dcp.h
  18. */
  19.  
  20. /* DCP a uucp clone. Copyright Richard H. Lamb 1985,1986,1987 */
  21.  
  22. #define MAXPACK 256
  23.  
  24. #define ERROR   10
  25. #define EMPTY   11
  26.  
  27. /*--------------------------------------------------------------------*/
  28. /*    Define high level state machine levels.  These levels define    */
  29. /*    processing during initialization, connection and                */
  30. /*    termination, but not during actual file transfers               */
  31. /*--------------------------------------------------------------------*/
  32.  
  33. typedef enum {
  34.       CONN_INITIALIZE = 'A',  /* Select system to call, if any       */
  35.       CONN_CALLUP,            /* Dial out to another system          */
  36.       CONN_HOTMODEM,          /* Initialize for a modem already
  37.                                  off-hook                            */
  38.       CONN_ANSWER,            /* Wait for phone to ring and user to
  39.                                  login                               */
  40.       CONN_LOGIN,             /* Modem is connected, do a login      */
  41.       CONN_HOTLOGIN,          /* Modem is connected, initialize user
  42.                                  from command line w/o login         */
  43.       CONN_PROTOCOL,          /* Exchange protocol information       */
  44.       CONN_SERVER,            /* Process files after dialing out     */
  45.       CONN_CLIENT,            /* Process files after being called    */
  46.       CONN_TERMINATE,         /* Terminate procotol                  */
  47.       CONN_DROPLINE,          /* Hangup the telephone                */
  48.       CONN_EXIT }             /* Exit state machine loop             */
  49.       CONN_STATE ;
  50.  
  51. /*--------------------------------------------------------------------*/
  52. /*                        File transfer states                        */
  53. /*--------------------------------------------------------------------*/
  54.  
  55. typedef enum {
  56.       XFER_SENDINIT = 'a',    /* Initialize outgoing protocol        */
  57.       XFER_MASTER,            /* Begin master mode                   */
  58.       XFER_FILEDONE,          /* Receive or transmit is complete     */
  59.       XFER_NEXTJOB,           /* Look for work in local queue        */
  60.       XFER_REQUEST,           /* Process work in local queue         */
  61.       XFER_PUTFILE,           /* Send a file to remote host at our
  62.                                  request                             */
  63.       XFER_GETFILE,           /* Retrieve a file from a remote host
  64.                                  at our request                      */
  65.       XFER_SENDDATA,          /* Remote accepted our work, send data */
  66.       XFER_SENDEOF,           /* File xfer complete, send EOF        */
  67.       XFER_NOLOCAL,           /* No local work, remote have any?     */
  68.       XFER_SLAVE,             /* Begin slave mode                    */
  69.       XFER_RECVINIT,          /* Initialize Receive protocol         */
  70.       XFER_RECVHDR,           /* Receive header from other host      */
  71.       XFER_GIVEFILE,          /* Send a file to remote host at their
  72.                                  request                             */
  73.       XFER_TAKEFILE,          /* Retrieve a file from a remote host
  74.                                  at their request                    */
  75.       XFER_RECVDATA,          /* Receive file data from other host   */
  76.       XFER_RECVEOF,           /* Close file received from other host */
  77.       XFER_NOREMOTE,          /* No remote work, local have any?     */
  78.       XFER_LOST,              /* Lost the other host, flame out      */
  79.       XFER_ABORT,             /* Internal error, flame out           */
  80.       XFER_ENDP,              /* End the protocol                    */
  81.       XFER_EXIT               /* Return to caller                    */
  82.       } XFER_STATE ;
  83.  
  84. #define RETRY   (-2)
  85. #define FAILED  (-1)
  86. #define OK              0
  87.  
  88. typedef int     (*procref)();
  89.  
  90. typedef struct {
  91.         char type;
  92.         procref getpkt, sendpkt, openpk, closepk, rdmsg, wrmsg, eofpkt,
  93.                   filepkt;
  94. } Proto;
  95.  
  96.  
  97. extern size_t pktsize;             /* packet size for this protocol*/
  98. extern FILE *syslog;            /* syslog file pointer                  */
  99. extern char workfile[FILENAME_MAX];
  100.                                 /* name of current workfile             */
  101. extern FILE *fwork;             /* current work file pointer    */
  102. extern FILE *xfer_stream;       /* current disk file stream for file
  103.                                    being transfered                     */
  104. extern FILE *fsys;
  105.  
  106. extern boolean callnow;         /* TRUE = call no matter what L.SYS says */
  107.  
  108. extern char *Rmtname;           /* system we WANT to talk to    */
  109.  
  110. extern char rmtname[20];        /* system we end up talking to  */
  111.  
  112. extern char s_systems[FILENAME_MAX];
  113.                                 /* full-name of systems file    */
  114. extern struct HostTable *hostp;
  115. extern struct HostStats remote_stats;
  116.                                  /* host status, as defined by hostatus */
  117.  
  118. int    dcpmain(int  argc,char  * *argv);
  119.  
  120. #endif /* __DCP */
  121.